import { createStore } from 'vuex'

export default createStore({
  state: {
    curUser:sessionStorage.getItem("cur_user")!=null?JSON.parse(sessionStorage.getItem("cur_user")):null
  },
  getters: {
  },
  mutations: {
    setCurUser(state,user){
      state.curUser=user
      sessionStorage.setItem("cur_user",JSON.stringify(user));
    },
    delCurUser(state){
      state.curUser=null;
      sessionStorage.removeItem("cur_user");
    }
  },
  actions: {
  },
  modules: {
  }
})
